package com.jekun.helloworld.designmode.command.demo02;

/**
 * @author Administrator
 */
public class CalculatorForm {
    private AbstractCommand command;

    public void setCommand(AbstractCommand command) {
        this.command = command;
    }

    public String operation(int value) {
        int i = command.execute(value);
        return "执行运算，运算结果为：" + i;
    }

    public String undo() {
        int i = command.undo();
        return "执行撤销，运算结果为：" + i;
    }
}
